#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read(){
	int x=0;bool f=0;char ch=getchar();
	while(ch<'0'||ch>'9')f^=(ch=='-'),ch=getchar();
	while('0'<=ch&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return f?-x:x;
}
signed main(){
	freopen("tree.in","r",stdin);
	freopen("tree.out","w",stdout);
	int T=read();
	while(T--){
		int x=read();
		if(!x){
			puts("2");continue;
		}
		int op=0;
		double pd=sqrt(x);
		int pdd=sqrt(x),pddd=pdd;
		pd-=pdd;pd=pd*10;pdd=pd;
		if(pdd%10>=5||x%2==1||pddd*pddd==x)op=1;
		int tmp=ceil(sqrt(x))*2;
		printf("%lld\n",tmp+op);
	}
	return 0;
}
/*
1
831168900

10
748
343
758
326
880
650
331
358
950
423
*/
